//数据格式注册——豪车俱乐部
module RegDataHcjlb {
    //区域索引
    export let ID_MASERATI = 1									//玛莎拉蒂	
    export let ID_FERRARI = 2									//法拉利		
    export let ID_LAMBORGHINI = 3									//兰博基尼		
    export let ID_PORSCHE = 4									//保时捷		
    export let ID_LANDROVER = 5									//路虎	
    export let ID_BMW = 6									//宝马	
    export let ID_JAGUAR = 7									//捷豹	
    export let ID_BENZ = 8									//奔驰	
    export let KIND_ID = 140									//游戏 I D
    export let AREA_MASERATI = 0
    export let AREA_FERRARI = 1
    export let AREA_LAMBORGHINI = 2
    export let AREA_PORSCHE = 3
    export let AREA_LANDROVER = 4
    export let AREA_BMW = 5
    export let AREA_JAGUAR = 6
    export let AREA_BENZ = 7


    export let AREA_COUNT = 8									//区域数目
    export let AREA_ALL = 8									//动物种类
    export let ANIMAL_COUNT = 16                                  //动物个数
    //赔率定义
    export let RATE_TWO_PAIR = 12									//对子赔率
    export let SERVER_LEN = 32

    export let BETTING_ITEM_COUNT = 8
    export let TopPlayerNum = 3
    export let NICKNAME_LEN = 32							//房间长度
    export let DEFAULT_BANK_SCORE_TRUE = 9999900    //真钱版默认庄家金币
    export let GAME_TYPE_REAL_MONEY = 9999999999      //金币版默认庄家金币

    // enum BettingItem 
    //     {
    //         enBigBenz=1,                    //大奔驰
    //         enSmallBenz,                  //小奔驰
    //         enBigVW,                      //大大众
    //         enSmallVW,                    //小大众
    //         enBigPorsche,                 //大保时捷
    //         enSmallPorsche,               //小保时捷
    //         enBigBMW,                     //大宝马
    //         enSmallBMW,                   //小宝马

    //     };

    // #ifndef GAME_TYPE_REAL_MONEY
    // const LONGLONG OneThousand = 1000;//一千
    // const LONGLONG TenThousand = 10*OneThousand;//一万
    // const LONGLONG HundredThousand = 10*TenThousand;//十万
    // const LONGLONG OneMillion = 10*HundredThousand;//一百万
    // const LONGLONG FiveMillion = 5*OneMillion;//五百万
    // const LONGLONG TenMillion =	10*OneMillion;//一千万 
    // #else
    // const LONGLONG OneThousand = 10;
    // const LONGLONG TenThousand = 100;
    // const LONGLONG HundredThousand = 1000;
    // const LONGLONG OneMillion = 5000;
    // const LONGLONG FiveMillion = 10000;
    // const LONGLONG TenMillion = 20000; 
    // #endif
    //BYTE,CHAR 1字节  TCHAR是char数组形式 如果是TCHAR是中文数据则用CHINESE
    //WORD 2字节
    //DWORD int LONG 4字节
    //SCORE 8字节
    //游戏配置
    export let CMD_GF_GameOption = {
        wMainCmdID: 100,
        wSubCmdID: 1,
        nLenght: 9,
        data: [
            ["wVisit", "BYTE"],
            ["wVersion", "DWORD"],
            ["wGameVersion", "DWORD"]
        ]
    }

    //请求坐下
    export let CMD_GP_UserQuickSitdown = {
        wMainCmdID: 3,
        wSubCmdID: 13,
        nLenght: 0,
        data: [

        ]
    }
    //用户下注
    export let CMD_GP_PlaceJetton = {
        wMainCmdID: 200,
        wSubCmdID: 11,
        nLenght: 9,
        data: [
            ["cbJettonArea", "BYTE"],    //下注项目
            ["lJettonScore", "DLONG"],   //下注数量
        ]

    }
    //玩家申请坐庄（使用）
    export let CMD_GP_ApplyBanker = {
        wMainCmdID: 9,
        wSubCmdID: 2,
        nLenght: 0,
        data: [

        ]

    }
    //玩家取消做庄（使用）
    export let CMD_GP_CancelBanker = {
        wMainCmdID: 9,
        wSubCmdID: 3,
        nLenght: 0,
        data: [

        ]

    }
    //庄家申请列表
    export let CMD_GP_ContinueCard = {
        wMainCmdID: 9,
        wSubCmdID: 4,
        nLenght: 0,
        data: [

        ]

    }
    //开奖记录
    export let CMD_GP_AmdinCommand = {
        wMainCmdID: 9,
        wSubCmdID: 5,
        nLenght: 0,
        data: [

        ]

    }
    //获取申请上庄列表
    export let CMD_GP_GetAccount = {
        wMainCmdID: 9,
        wSubCmdID: 20,
        nLenght: 0,
        data: [

        ]

    }

    //游戏空闲
    export let gameFree = [
        ["cbTimeLeave", "BYTE"],        //剩余时间
        ["lUserMaxScore", "DLONG"],        //玩家金币
        ["wBankerUser", "WORD"],        //当前庄家
        ["cbBankerTime", "WORD"],        //庄家局数

        ["lBankerWinScore", "DLONG"],        //庄家成绩
        ["lBankerScore", "DLONG"],        //庄家分数
        ["bEnableSysBanker", "BOOL"],        //系统做庄

        ["lApplyBankerCondition", "DLONG"],        //申请条件
        ["lAreaLimitScore", "DLONG"],        //区域限制

        ["szGameRoomName", "TCHARS", 32],        //房间名称
    ];
    //游戏下注
    export let gamePlay = [
        ["lCellScore", "DLONG[]", AREA_COUNT + 1],        //全体总注
        ["lUserJettonScore", "DLONG[]", AREA_COUNT + 1],        //个人总注

        ["lUserMaxScore", "DLONG"],        //最大下注

        ["lApplyBankerCondition", "DLONG"],        //申请条件
        ["lAreaLimitScore", "DLONG"],        //区域限制

        ["cbTableCard", "BYTE"],        //桌面扑克

        ["wBankerUser", "WORD"],        //当前庄家
        ["cbBankerTime", "WORD"],        //庄家局数
        ["lBankerWinScore", "DLONG"],        //庄家赢分
        ["lBankerScore", "DLONG"],        //庄家分数
        ["bEnableSysBanker", "BOOL"],        //系统做庄

        ["lEndBankerScore", "DLONG"],        //庄家成绩
        ["lEndUserScore", "DLONG"],        //玩家成绩
        ["lEndUserReturnScore", "DLONG"],        //返回积分
        ["lEndRevenue", "DLONG"],        //游戏税收

        ["cbTimeLeave", "BYTE"],        //剩余时间
        ["cbGameStatus", "BYTE"],        //游戏状态
        ["szGameRoomName", "TCHARS", 32],        //房间名称

    ]



    export let MainCMD_MsgId = {
        1: {
            //登陆成功
            100: [
                ["dwUserRight", "DWORD"],        //用户权限
                ["dwMasterRight", "DWORD"],       //管理权限
            ],
            //登陆失败
            101: [
                ["lErrorCode", "DWORD"],        //错误代码
                ["szDescribeString", "TCHARS", 128],       //描述
            ],
            //登陆完成
            102: [


            ],
            //登陆游戏时发现在其他房间
            103: [
                ["wServerID", "WORD"],        //其他游戏房间的serverID
            ],
            //重选服务器-选桌类型
            104: [

            ],
            //升级提示
            200: [
                ["cbMustUpdatePlaza", "BYTE"],        //强行升级
                ["cbMustUpdateClient", "BYTE"],       //强行升级
                ["cbAdviceUpdateClient", "BYTE"],        //建议升级
                ["dwCurrentPlazaVersion", "DWORD"],       //当前版本
                ["dwCurrentFrameVersion", "DWORD"],        //当前版本
                ["dwCurrentClientVersion", "DWORD"],       //当前版本
            ]
        },
        2: {
            //列表配置
            100: [
                ["cbColumnCount", "BYTE"],      //列表数目
                ["ColumnItem", "STRUCT[]", [
                    ["cbColumnWidth", "BYTE"],        //列表宽度
                    ["cbDataDescribe", "BYTE"],        //字段类型
                    ["szColumnName", "TCHAR", 16],       //列表名字
                ], 16],        //列表描述
            ],
            //房间配置
            101: [
                ["wTableCount", "WORD"],        //桌子数目
                ["wChairCount", "WORD"],        //椅子数目
                ["wServerType", "WORD"],        //房间类型
                ["dwServerRule", "DWORD"],        //房间规则
            ],
            //完成配置
            103: [

            ],
            //玩家权限
            104: [
                ["dwUserRight", "DWORD"],        //玩家权限
            ],
        },
        3: {
            //用户规则
            1: [
                ["cbRuleMask", "BYTE"],        //规则掩码
                ["wMinWinRate", "WORD"],        //最低胜率
                ["wMaxFleeRate", "WORD"],        //最高逃率
                ["lMaxGameScore", "LONG"],        //最高分数
                ["lMinGameScore", "LONG"],        //最低分数
                ["szPassword", "TCHAR", 33],        //桌子密码
            ],
            //旁观请求
            2: [

            ],
            //请求坐下
            3: [
                ["wTableID", "WORD"],        //桌子位置
                ["wChairID", "WORD"],        //椅子位置
                ["szPassword", "TCHAR", 33],        //桌子密码
            ],
            //拒绝黑名单坐下
            7: [
                ["wTableID", "WORD"],        //桌子位置
                ["wChairID", "WORD"],        //椅子位置
                ["dwUserID", "TCHAR", 33],        //用户ID
                ["dwRepulseUserID", "DWORD"]        //用户ID
            ],
            //提出用户
            8: [
                ["dwTargetUserID", "DWORD"],        //用户标识
            ],
            //用户信息
            100: [
                ["tagMobileUserInfoHead", "SPSTRUCT", [
                    ["dwGameID", "DWORD"],        //游戏 I D
                    ["dwUserID", "DWORD"],        //用户 I D
                    ["dwGroupID", "DWORD"],        //社团 I D
                    ["wFaceID", "WORD"],        //头像索引
                    ["dwCustomID", "DWORD"],        ////自定标识
                    ["bIsAndroid", "BOOL"],        ////机器标识
                    ["cbGender", "BYTE"],        ////用户性别
                    ["cbMemberOrder", "BYTE"],        ////会员等级
                    ["cbTrader", "BYTE"],        ////管理等级
                    ["wTableID", "WORD"],        ////桌子索引
                    ["wChairID", "WORD"],        ////椅子索引
                    ["cbUserStatus", "BYTE"],        ////用户状态
                    ["lScore", "DLONG"],        ////用户分数  用户的money
                    ["lGrade", "DLONG"],        ////用户成绩
                    ["lInsure", "DLONG"],        ////用户银行
                    ["lIngot", "DLONG"],        ////用户元宝
                    ["dBeans", "DOUBLE"],        ////用户游戏豆
                    ["dwWinCount", "DWORD"],        //胜利盘数
                    ["dwLostCount", "DWORD"],        //失败盘数
                    ["dwDrawCount", "DWORD"],        //和局盘数
                    ["dwFleeCount", "DWORD"],        //逃跑盘数
                    ["dwExperience", "DWORD"],        //用户经验
                    ["lLoveLiness", "DWORD"],        //用户魅力
                    ["lIntegralCount", "DLONG"],        //积分总数
                    ["dwAgentID", "DWORD"],        //代理 I D
                ]]
            ],
            //用户分数
            101: [
                ["dwUserID", "DWORD"],        //桌子位置
                ["UserScore", "STRUCT", [
                    ["lScore", "DLONG"],        //用户分数
                    ["lGrade", "DLONG"],        //用户成绩
                    ["lInsure", "DLONG"],        //用户银行
                    ["lIngot", "DLONG"],        //用户银行
                    ["dBeans", "BYTE"],        //用户银行
                    ["dwWinCount", "DWORD"],        //胜利盘数
                    ["dwLostCount", "DWORD"],        //失败盘数
                    ["dwDrawCount", "DWORD"],        //和局盘数
                    ["dwFleeCount", "DWORD"],        //逃跑盘数
                    ["dwUserMedal", "DLONG"],        //用户奖牌
                    ["dwExperience", "DWORD"],        //用户经验
                    ["lLoveLiness", "DLONG"]        //用户魅力
                ]],        //积分信息
            ],

            //用户状态
            102: [
                ["dwUserID", "DWORD"],        //用户标识
                ["tableId", "WORD"],
                ["wChairID", "WORD"],
                ["cbUserStatus", "BYTE"]
            ],
            //请求失败
            103: [
                ["lErrorCode", "LONG"],        //错误码
                ["wServerType", "WORD"],        //错误码
                ["szDescribeString", "TCHARS", 256]        //描述信息
            ],
            //踢出用户
            104: [
                ["dwTargetUserID", "DWORD"],        //目标用户
            ],
        },
        100: {
            //游戏状态
            100: [
                ["cbGameStatus", "BYTE"],        //游戏状态
                ["cbAllowLookon", "BYTE"],        //旁观标志
            ],
            101: [

            ],
            //用户匹配状态
            103: [],
            //可进行游戏状态
            104: [],
            //系统消息
            200: [
                ["wType", "WORD"],        //消息类型
                ["wLength", "WORD"],        //消息长度
                ["szString", "TCHARS", 1024],        //内容
            ],
            300: [
                ["szSerialNumber", "TCHARS", 66] //牌局编号
            ]
        },
        200: {
            //游戏空闲
            99: [
                ["cbTimeLeave", "BYTE"],//剩余时间
            ],
            //游戏开始
            100: [
                ["wBankerUser", "WORD"],        //庄家位置
                ["lBankerScore", "DLONG"],        //庄家金币
                ["lUserMaxScore", "DLONG"],
                ["cbTimeLeave", "BYTE"],
                ["bContiueCard", "BOOL"]
            ],
            //用户下注
            101: [

                ["wChairID", "WORD"],    //位置
                ["cbJettonArea", "BYTE"],     //筹码区域  
                ["lJettonScore", "DLONG"],    //加注数目
                ["cbAndroid", "BYTE"],       //是否机器人
            ],
            // 游戏结束
            102: [
                ["cbTimeLeave", "BYTE"],       //剩余时间
                ["cbTableCard", "BYTE"],       //桌面扑克
                ["lBankerScore", "DLONG"],    //庄家成绩
                ["lBankerTotallScore", "DLONG"],       //庄家成绩
                ["nBankerTime", "DWORD"],       //做庄次数
                ["lUserScore", "DLONG"], //玩家成绩
                ["lUserReturnScore", "DLONG"],       //返回积分
                ["lRevenue", "DLONG"],       //游戏税收
            ],
            //申请庄家
            103: [
                ["wApplyUser", "WORD"], //申请玩家
            ],
            // 切换庄家
            104: [
                ["wBankerUser", "WORD"],    //当庄玩家
                ["lBankerScore", "DLONG"],    //庄家金币
            ],
            // 更新积分
            105: [
                ["wChairID", "WORD"],    //椅子号码
                ["lScore", "DOUBLE"],    //玩家积分
                ["wChairID", "WORD"],    //当庄玩家
                ["wCurrentBankerChairID", "WORD"],    //当庄玩家
                ["cbBankerTime", "BYTE"],    //庄家局数
                ["lCurrentBankerScore", "DOUBLE"],    //庄家分数
            ],
            //游戏记录
            106: [
                ["struGameRecord", "STRUCT[]", [
                    ["bWinShunMen", "BYTE"],     //顺门胜利
                    ["bWinDuiMen", "BYTE"],     //对门胜利
                    ["bWinDaoMen", "BYTE"],    //倒门胜利
                    ["bWinHuang", "BYTE"],    //倒门胜利
                ], 16], //游戏空闲
            ],

            //用户下注失败
            107: [
                ["wPlaceUser", "WORD"],     //下注玩家
                ["lJettonArea", "BYTE"],     //下注区域
                ["lPlaceScore", "DLONG"],    //当前下注
            ],

            //取消申请  9   3
            108: [
                ["szCancelUser", "WORD"], //取消玩家
            ],
            //取消申请  9   3
            113: [
                ["lJettonScore", "DLONG"], //用户取消下注
            ],
        }
        ,
        4: {
            //桌子信息
            100: [
                ["wTableCount", "WORD"],        //桌子数量
                ["TableStatusArray", "STRUCT[]", [
                    ["cbTableLock", "BYTE"],     //锁定标志
                    ["cbPlayStatus", "BYTE"],       //游戏标志
                ], 512] //桌子状态
            ],
            //桌子状态
            101: [
                ["wTableID", "WORD"],        //桌子数量
                ["TableStatus", "STRUCT", [
                    ["cbTableLock", "BYTE"],     //锁定标志
                    ["cbPlayStatus", "BYTE"],       //游戏标志
                ]] //桌子状态
            ]

        },
        5: {
            //银行资料返回
            100: [
                ["cbActivityGame", "BYTE"],        //游戏动作
                ["wRevenueTake", "WORD"],        //税收比列
                ["wRevenueTransfer", "WORD"],        //税收比列
                ["wServerID", "WORD"],        //房间标识
                ["lUserScore", "SCORE"],        //用户金币
                ["lUserInsure", "SCORE"],        //银行金币
                ["lTransferPrerequisite", "SCORE"],        //转账条件
            ],
            //银行操作成功
            101: [
                ["cbActivityGame", "BYTE"],        //游戏动作
                ["lUserScore", "SCORE"],        //身上金币
                ["lUserInsure", "SCORE"],        //银行金币
                ["szDescribeString", "CHINESE", 128],        //描述消息
            ],
            //银行操作失败
            102: [
                ["cbActivityGame", "BYTE"],        //游戏动作
                ["lErrorCode", "LONG"],        //错误代码
                ["szDescribeString", "CHINESE", 128],        //描述消息
            ],
        },
        // //管理员命令
        // 6:{
        //     //警告消息
        //     1:[
        //         ["wChatLength", "WORD"],        //信息长度
        //         ["dwTargetUserID", "DWORD"],        //目标用户
        //         ["szWarningMessage", "CHINESE",128],        //警告消息
        //     ],
        //     //接受消息
        //     2:[
        //         ["cbGame", "WORD"],        //游戏标识
        //         ["cbRoom", "DWORD"],        //房间标识
        //         ["cbAllRoom", "CHINESE",128],        //所有房间
        //         ["wChatLength", "DWORD"],              //消息长度
        //         ["szSystemMessage", "CHINESE",128],        //系统消息
        //     ],
        // },

        8: {
            //游戏状态
            100: [
                ["cbGameStatus", "WORD"],        //游戏状态
                ["cbAllowLookon", "DWORD"],        //旁观标志
            ],
            //用户匹配状态
            103: [],
            //可进行游戏状态
            104: [],
            //系统消息
            200: [
                ["wType", "WORD"],        //游戏状态
                ["szName", "DWORD"],        //mingzi
                ["wLength", "WORD"],        //游戏状态
                ["szString", "CHINESE", 1024],        //内容
            ],

        }
        ,
        9: {

            //游戏开始
            100: [
                ["cbTimeLeave", "WORD"],   //剩余时间
            ],
            //用户下注
            101: [

                ["wUserID", "DWORD"],      //下注玩家ID
                ["wBetItem", "WORD"],   //下注项目
                ["wBetAmount", "LONGLONG"],       //下注数量
                ["ItemBetAmountNum", "WORD"],       //下注项总数量
                ["ItemBetAmount", "STRUCT[]", [
                    ["wBetItem", "WORD"],      //下注项目
                    ["dwBetAmounts", "DWORD"],   //下注金额
                ], 0],   //各下注项已下分  

            ],

            //申请庄家
            102: [
                ["successful", "WORD"],
                ["wApplyBankerNum", "WORD"],
                ["dwUserid", "DWORD"],
            ],
            //下注失败
            103: [

            ],
            //取消申请
            104: [
                ["successful", "WORD"],       //1:取消成功 0:失败
                ["wApplyBankerNum", "WORD"],       //申请庄家数
                ["dwUserid", "DWORD"],    //取消申请玩家ID  
            ],
            //游戏开奖
            105: [

                ["wTimeLeave", "WORD"], //剩余时间
                ["wWhichOne", "WORD"], //本次选中哪一个
                ["dwBankerScore", "LONGLONG"], //庄家本局赢的金币
                ["wBankOnJobTimes", "DWORD"], //庄家坐庄次数
                ["PlayerInfoArray", "STRUCT[]", [
                    ["cPlayerName", "CHINESE", 32], //名字
                    ["llProfit", "LONGLONG"], //盈利
                ], TopPlayerNum], //剩余时间
                ["llTotalPfofit", "LONGLONG"], //玩家本局总盈利
            ],
            //押注状态
            106: [
                ["dwTimeLeave", "DWORD"],    //当庄玩家
                ["sItemAmount", "STRUCT[]", [
                    ["wBetItem", "WORD"],      //下注项目
                    ["dwBetAmounts", "DWORD"],   //下注金额
                ], BETTING_ITEM_COUNT],    //庄家名称
                ["sBetingItemInfo", "STRUCT[]", [
                    ["wBetItem", "WORD"],      //下注项目
                    ["dwBetAmounts", "DWORD"],   //下注金额
                ], BETTING_ITEM_COUNT],     //庄家金币
            ],
            //开奖状态
            107: [
                ["dwTimeLeave", "DWORD"],    //剩余时间
            ],
            //空闲状态
            108: [
                ["dwTimeLeave", "DWORD"],
            ],
            //庄家申请列表
            109: [

            ],
            //场景信息
            110: [
                ["cBankName", "CHINESE", NICKNAME_LEN], //庄家昵称
                ["llBankerScore", "LONGLONG"], //庄家金币
                ["wApplyBankerNum", "WORD"], //申请庄家数
                ["sItemOdds", "STRUCT[]", [
                    ["wBetItem", "WORD"], //下注项目
                    ["wOdds", "WORD"], //项目赔率
                ], BETTING_ITEM_COUNT], //取消玩家
                ["BankerLowestProperty", "LONGLONG"], //庄家最低金币
                ["wRecordNumber", "WORD"], //历史个数
                ["wDrawRecord", "WORD[]", 0], //开奖历史
            ],
            //庄家易主
            111: [
                ["cBankName", "CHINESE", NICKNAME_LEN], //庄家昵称
                ["llBankerScore", "LONGLONG"], //庄家分数
                ["llApplyBankerNum", "DWORD"], //申请庄家人数
                ["dwmBankerOnJobTimes", "DWORD"], //庄家连庄次数
                ["dwUserID", "DWORD"], //用户id
            ],
            //剔除队列
            112: [

            ],
            //机器人投注
            113: [
                // ["VecSize", "DWORD"], //取消玩家
                // ["AndroidPlaceInfoVec", "STRUCT[]",[
                //     ["wBetItem", "WORD"],      //下注项目
                //      ["dwBetAmounts", "DWORD"],   //下注金额
                // ],1], //取消玩家
            ],
            //机器人抢庄
            114: [

            ],
            //真人下注
            115: [
                ["cbJettonArea", "BYTE"], //筹码区域
                ["lJettonScore", "LONGLONG"], //加注数量
            ],

            //庄家信息列表
            120: [
                ["cbApplyNum", "BYTE"], //申请庄家人数
                ["sApplyBanker", "STRUCT[]", [
                    ["lScore", "LONGLONG"], //用户金币
                    ["szNickName", "CHINESE", 32], //用户昵称
                ], 5], //申请庄家信息
            ],
            //庄家信息
            121: [
                ["cbContinue", "BYTE"], //连续坐庄次数

                ["szNickName", "CHINESE", 32], //庄家名称
            ],




        },
        1000: {
            1: [
                ["wType", "WORD"],  //消息类型 1聊天消息 2弹出消息 4全局消息 8提示消息 16滚动消息
                ["szName", "TCHAR", 32],  //发送者
                ["wLength", "WORD"],  //消息长度
                ["szString", "CHINESE", 1024],  //消息内容
            ],
        }
    }
    //手机登陆
    export let CMD_GP_LogonMobile = {
        wMainCmdID: 1,
        wSubCmdID: 2,
        nLenght: 81,
        data: [
            ["wGameID", "WORD"],                //游戏标识
            ["dwProcessVersion", "DWORD"],       //远程版本
            ["cbDeviceType", "BYTE"],           //设备类型
            ["wBehaviorFlags", "WORD"],        //行为标识
            ["wPageTableCount", "WORD"],       //分页卓数
            ["dwUserID", "DWORD"],              //ID登陸
            ["szPassword", "TCHAR", 33],        //登陆密码
            ["szMachineID", "TCHAR", 33],       //机器序列
        ]
    }

}
